<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>员工管理</title>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<link href="../js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="../laypage/skin/laypage.css"  rel="stylesheet">
<!-- 可选的Bootstrap主题文件（一般不使用） -->
<script src="../js/bootstrap/css/bootstrap-theme.min.css"></script>
<link rel="stylesheet" type="text/css" href="../mycss/style.css" />
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script type="text/javascript" src="../laypage/laypage.js"></script>
<script src="../js/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
<script src="heyun.js"></script>
<style type="text/css">
 #menu{
    margin-left: 50%;
    
 }
/* #menu .table{
     border: 0px solid transparent !important;
 } */
</style>

<script type="text/javascript">
  $(function(){
	  getAllEmp(1);
	  getDeptRole();
  })
</script>
</head>
<body id="tablePage">
 <div>	
		<blockquote>
			<p class="twoType">员工管理</p>
		</blockquote> 	
		<hr/>
		<form action=""  id="search">
		   <table class="table">
		    <tr>
		     <td>姓名</td>
		     <td> <input type="text" name="empRealName" id="searchName" /> </td>
		    </tr>
		     <tr>
		     <td>入职时间:</td>
		     <td>从<input type="text" name="gthireDate"  class="Wdate" onclick="WdatePicker()"/>到
		       <input type="text" name="lthireDate2" class="Wdate" onclick="WdatePicker()"/>  
		     </td>
		    </tr>
		      <tr>
		     <td>部门</td>
		     <td> 
		     <select name="deptId" id="searchDept">
		     <option></option>
		     </select>
		     </td>
		    </tr>
		      <tr>
		     <td>备注信息</td>
		     <td> <input type="text" name="remarks" id="searchRemarks"/></td>
		    </tr>
		      <tr>
		     <td colspan="2" style="text-align: center"> 
		     <input type="button" name="remarks"  value="提交查询" onclick="searchEmp(1)"/></td>
		    </tr>
		   </table>    
		</form>
	<div class="btnChange">
	<div id="menu" >
	<table  class="table"  >
	 <tr>
	   <td>
	<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" onclick="getDeptRole()">
	添加
    </button>
     <!-- 模态框（Modal） -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
					添加员工
				</h4>
			</div>
			<div class="modal-body">
				   <form action="savedept" method="post" id="emp">
				       <table class="table" border="0">
				           <tr>
				             <td>员工姓名</td>
				             <td><input type="text" name="empRealName" ></td>
				           </tr>
				            <tr>
				             <td>员工性别</td>
				             <td>
				               <input type="radio" name="gender" value="男"/> 男
				                <input type="radio" name="gender" value="女" />女
				             </td>
				           </tr>
				            <tr>
				             <td>手机号</td>
				             <td>
				               <input type="text" name="phone" />
				             </td>
				           </tr>
				              <tr>
				              <td>所属部门</td>
				              <td>
				              <select  id="empDept" name="deptId" onchange="getRoleName()">
				                <option selected="selected"></option>
				              </select>
				              </td>
				              </tr>
				              <tr>
				              <td>角色身份</td>
				              <td >
				              
				              <select  id="empRole" name="roleId" >
				                <option selected="selected"></option>
				              </select>
				              </td>
				              </tr>
				            <tr>
				             <td>员工备注信息</td>
				             <td>
				              <textarea rows="10" cols="50" name="empRemarks">
				              </textarea>
				             </td>
				           </tr>
				       </table>
				   </form>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal" >取消添加
				</button>
				<button type="button" class="btn btn-primary" onclick="saveEmp()">
					保存
				</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
    </div></td>
    <td>
  <button class="btn btn-default btn-lg"  onclick="updateState()">
	启用/停用
 </button>
    </td>
	   <td>
 <button class="btn btn-warning btn-lg" data-toggle="modal" data-target="#myModal1" onclick="getEmpMessage()">
	修改
 </button>
  <!-- 模态框（Modal） -->
  <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
					员工修改
				</h4>
			</div>
			<div class="modal-body">
				   <form action="saveEmp" method="post" id="empMessage">
				       <table class="table" border="0">
				       <tr>
				         <td>员工编号</td>
				         <td><input type="text" name="empId" readonly="readonly" id="empId"/></td>
				       </tr>
				          <tr>
				             <td>员工姓名</td>
				             <td><input type="text" name="empRealName" id="empRealName"></td>
				           </tr>
				            <tr>
				             <td>性别</td>
				             <td>
				               <input type="radio" name="gender" id="gender" value="男" />男
				               <input type="radio" name="gender" id="gender" value="女" />女
				             </td>
				           </tr>
				            <tr>
				             <td>状态</td>
				             <td>
				               <input type="radio" name="state" id="state" value="0" />启用
				               <input type="radio" name="state" id="state" value="1" />停用
				             </td>
				           </tr>
				           <tr>
				             <td>部门</td>
				             <td>
				              <select name="deptId" id="deptId" onchange="getNewRole()">
				               
				              </select>
				             </td>
				           </tr>
				              <tr>
				             <td>角色</td>
				             <td>
				              <select name="roleId" id="roleId">
				               
				              </select>
				             </td>
				           </tr>
				            <tr>
				             <td>手机号</td>
				             <td>
				             <input type="text" name="phone" id="phone"/>
				             </td>
				           </tr>
				            <tr>
				             <td>备注</td>
				             <td>
				              <textarea rows="10" cols="50" name="empRemarks" id="empRemarks">
				              </textarea>
				             </td>
				           </tr>
				       </table>
				   
				   </form>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal" >取消修改
				</button>
				<button type="button" class="btn btn-primary" onclick="updateEmp()">
					保存
				</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
    </div>
 </td>
	<td>
<button class="btn btn-default btn-lg"  onclick="deleteEmp()">
	删除
 </button>

	   </td>
	 </tr>
	
	</table>
	</div>
	</div>
	<div class="tableDiv">
		<form action=""  id="roleTable">
		<table id="conTable" class="table table-bordered">
  <tr class="info"><td></td><td></td><td>员工姓名</td><td>性别</td><td>所在部门</td>
  <td>角色</td><td>状态</td><td>入职时间</td><td>直接领导</td></tr>
			<!-- <tfoot><tr style="border:0px"><td><div id="page"></div></td></tr></tfoot> -->
		 </table>	
	</form>
	</div>
		
</div>
</body>
</html>